# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=signon-plugin-oauth2
pkgver=0.24
pkgrel=1
arch="all"
url="https://gitlab.com/accounts-sso/signon-plugin-oauth2"
pkgdesc="Signond OAuth 1.0 and 2.0 plugin"
license="LGPL-2.1-only"
makedepends="qt5-qtbase-dev signond-dev"
source="https://gitlab.com/accounts-sso/signon-plugin-oauth2/-/archive/VERSION_$pkgver/signon-plugin-oauth2-VERSION_$pkgver.tar.gz
	disable-werror.patch"
subpackages="$pkgname-dev"
builddir="$srcdir/$pkgname-VERSION_$pkgver"

prepare() {
	default_prepare

	# Don't install tests and example
	echo 'INSTALLS =' >> tests/tests.pro
	echo 'INSTALLS =' >> example/example.pro
}

build() {
	qmake-qt5 \
		PREFIX=/usr \
		LIBDIR=/usr/lib
	CPPFLAGS="$CPPFLAGS -Wno-error" make
}

check() {
	make check
}

package() {
	INSTALL_ROOT="$pkgdir" make install
}

sha512sums="8a1e5be7f34419ded7841cb4de62e03ab56556f39ae40e3e11b549d45c6c51edc6888d1aab254c0ba6746d6306bb8b92dd24e473387542d6a987208c20acf6d9  signon-plugin-oauth2-VERSION_0.24.tar.gz
aaec3780ec164e20917a635c6f56ddf9d467a555972276a72d72e256a913f1addeb2952fbc9f4af184fa12fe528d3c812469c9bc613d4bc11ebcd03ee80ec6ec  disable-werror.patch"
